
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import <OpenGLES/EAGL.h>
#import <OpenGLES/ES1/gl.h>
#import <OpenGLES/ES1/glext.h>
#import <QuartzCore/QuartzCore.h>
#import <CoreMotion/CoreMotion.h>
#import "InAppPurchaseManager.h"

@interface Application : UIView 
{
@private

	EAGLContext *context;
	
	// The OpenGL names for the framebuffer and renderbuffer used to render to this view
	GLuint defaultFramebuffer, colorRenderbuffer;
@public
	int appWidth;
	int appHeight;
	float contentScale;
	float inputScale;
    
    CMMotionManager* motionManager;
    float rotX, rotY, rotZ;
    float accelX, accelY, accelZ;
    float fCooldown;
}

- (id) initApp;
- (void) setup;
- (void) update:(float) dt;
- (void) render;
- (BOOL) resizeFromLayer:(CAEAGLLayer *)layer;

-(void) minimize;

-(void) loadState;
-(void) saveState;

- (void)touchStart:(CGPoint )point;
- (void)touchMoved:(CGPoint )point;
- (void)touchEnd:(CGPoint )point;

- (void) startAcceleration;
- (void) stopAcceleration;

@end
